<!--
 * @Description: 富文本使用
 * @Author: Zhanghan
 * @Date: 2024-12-06 16:02:28
 * @LastEditTime: 2024-12-10 11:30:25
 * @LastEditors: Zhanghan
-->
<template>
  <div class="w-full h-full">
    <div class="bg-green-400 mb-4">富文本编辑器使用</div>
    <div class="mr-auto w-1/2">
      <MyEditor @change="success" />
    </div>

    <div class="mt-4">
      <div class="font-bold mb-2">解析编辑器的文本内容</div>
      <div v-if="context" v-html="context"></div>
      <div v-else>暂无内容</div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { MyEditor } from "@/components/index";

const context = ref("");

const success = (val: any) => {
  context.value = val?.html;
};
</script>
